import { createApp } from 'vue'
import './assets/main.css'
import App from './App.vue'
import router from './router'
import { componentPlign } from './components/27/index.js'

//ElementPlus
import ElementPlus from 'element-plus'
import zhCn from 'element-plus/es/locale/lang/zh-cn'
import 'element-plus/dist/index.css'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'

//dayjs
import dayjs from 'dayjs'
import 'dayjs/locale/zh-cn';
import mitt from 'mitt'
dayjs.locale('zh-cn');

//pinia
import { createPinia } from 'pinia'
import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'
const pinia = createPinia()
pinia.use(piniaPluginPersistedstate) // 使用持久化插件

//
import '@/utils/rem'
const mitter = mitt()
const app = createApp(App)
app.config.globalProperties.$mitt = mitter
app.config.globalProperties.$dayjs = dayjs

for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}

app.use(router).use(componentPlign).use(pinia).use(ElementPlus, {
  locale: zhCn,
})

app.mount('#app')
